package FrontEnd.Helper;
import javax.swing.*;

import BackEnd.AuftragsManager;

public class LAFSetter {
	JFrame frame;
	private static LAFSetter instance = null;
	
	
	public LAFSetter() {
	}
	
	public void setFrame(JFrame frame){
		this.frame = frame;
	}

	public void metal(){
		setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
	}
	
	public void nimbus(){
		setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
	}
	
	public void motif(){
		setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
	}
	
	public void windows(){
		setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
	}
	
	public void eaSynth(){
		setLookAndFeel("com.easynth.lookandfeel.EaSynthLookAndFeel");
	}
	
	public void setLookAndFeel(String plaf) {
		try {
			UIManager.setLookAndFeel(plaf);
			SwingUtilities.updateComponentTreeUI(frame);
		} catch (UnsupportedLookAndFeelException e) {
			System.err.println(e.toString());
		} catch (ClassNotFoundException e) {
			System.err.println(e.toString());
		} catch (InstantiationException e) {
			System.err.println(e.toString());
		} catch (IllegalAccessException e) {
			System.err.println(e.toString());
		}
	}
	
	public static synchronized LAFSetter getInstance(){
		if(instance == null){
			instance = new LAFSetter();
		}
		return instance;
	}
}